home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / ip / ka9q / MacBMsrc.hqx / Mac bm Project / mac_intf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-23  |  1.1 KB  |  58 lines

  1. /* This file contains machine specific functions */
  2. #include <stdio.h>
  3. #include <unix.h>
  4. #include <types.h>
  5. #include <strings.h>
  6. #include "global.h"
  7.  
  8. /* This function should put the tty in a mode such that signgle characters
  9. * can be read without waiting for a complete line. Echo should be on.
  10. */
  11. setrawmode()
  12. {}
  13.  
  14. /* This function should restore the tty modes back to cooked mode */
  15. setcookedmode()
  16. {}
  17.  
  18. /* This function return one charater form the keyboard. It will wait
  19. * for a character to be input. This function will echo the character.
  20. * This funtion will return afer each character is typed if raw is set
  21. */
  22. int
  23. getrch()
  24. {
  25.     int    c;
  26.     c = getchar();
  27.     return c & 0xff;
  28. }
  29.  
  30. /* This function show clear screen and put cursor at top of screen */
  31. screen_clear()
  32. {
  33.     eraseplot();
  34. }
  35.  
  36. /*
  37. **    strcmpic: string compare, ignore case
  38. */
  39.  
  40. stricmp(s1, s2)
  41. char *s1, *s2;
  42. {
  43.     register char *u = s1;
  44.     register char *p = s2;
  45.  
  46.     while(*p != '\0') {
  47.         /* chars match or only case different */
  48.         if(tolower(*u) == tolower(*p)) {
  49.             p++;    /* examine next char */
  50.             u++;
  51.         } else {
  52.             break;    /* no match - stop comparison */
  53.         }
  54.     }
  55.  
  56.     return(tolower(*u) - tolower(*p)); /* return "difference" */
  57. }
  58.